<script setup lang="ts">
import { ref } from 'vue';
import microApp from '@micro-zoe/micro-app';

const data2 = {
  selectedId: '',
};

function vue1DataChange(e: any): void {
  microApp.setData('vue2', e.detail.data);
}
</script>

<template>
  <micro-app
    name="vue1"
    url="http://localhost:3001/users/tree"
    baseroute="/vue1"
    iframe
    @datachange="vue1DataChange"
  ></micro-app>

  <micro-app
    name="vue2"
    url="http://localhost:3002/users/details"
    baseroute="/vue2"
    :data="data2"
    iframe
  ></micro-app>
</template>

<style scoped></style>
